﻿using Abp.Domain.Entities.Auditing;
using Akso.Infrastructure.Data.Annotations;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Akso.Entities
{
    /// <summary>
    /// 账户管理，带审计和软删除。
    /// </summary>
    [Table("Finance_BillAccounts")] //对应数据库的表名，建议规则：模块名+实体名。
    public class BillAccount: FullAuditedEntity<Guid>
    {
        public const int MaxNameLength = 50;
        public const int MaxAccountTypeLength = 50;
        public const int MaxSchoolLength = 50;
        public const int MaxRemarkLength = 200;
        /// <summary>
        /// 账户名称
        /// </summary>
        [Required]//字段必填   
        [MaxLength(MaxNameLength)]
        public virtual string AccountName { get; set; }
        /// <summary>
        /// 账户类型
        /// </summary>
        [MaxLength(MaxAccountTypeLength)]
        public virtual string AccountType { get; set; }
        public virtual long? AccountTypeId { get; set; }
        /// <summary>
        /// 所属校区
        /// </summary>
        [MaxLength(MaxSchoolLength)]
        public virtual string SchoolName { get; set; } 
        public virtual Guid? SchoolId { get; set; }
        /// <summary>
        /// 是否用于前台收费
        /// </summary>
        public virtual bool IsTollAccount { get; set; }
        /// <summary>
        /// 余额
        /// </summary>
        [DecimalPrecision(10, 2)]
        public virtual decimal Balance { get; set; }
        [MaxLength(MaxRemarkLength)]
        public virtual string Remark { get; set; }
    }
}
